package passwordCheckerPrimeiraIteracao.testes;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import passwordCheckerPrimeiraIteracao.PasswordCheckerBasePrimeiraIteracao;

@RunWith(Parameterized.class)
public class CheckIfAtLeastOneSymbolTest {
	private boolean expectedAnswer;
	private String inputPassword;

	public CheckIfAtLeastOneSymbolTest(String pInputPassword,
			boolean expectedAnswer) {
		this.inputPassword = pInputPassword;
		this.expectedAnswer = expectedAnswer;
	}

	@Parameterized.Parameters
	public static Collection digitValidation() {
		return Arrays.asList(new Object[][] { { "luiz", false },
				{ "Luiz#", true }, { "#Luiz", true }, { "Luiz#@$", true },
				{ "Lu#@$iz", true } });
	}

	@Test
	public void SymbolValidation() {
		assertEquals(Boolean.valueOf(expectedAnswer),
				Boolean.valueOf((PasswordCheckerBasePrimeiraIteracao
						.checkIfAtLeastOneSymbol(inputPassword))));
	}
}
